﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteRequireLogin.Master" AutoEventWireup="true" CodeBehind="DanhMucCauHoi.aspx.cs" Inherits="TranTekBE.Trac_Nghiem.DanhMucCauHoi" %>

<%@ Register Src="~/Trac-Nghiem/MenuTracNghiem.ascx" TagPrefix="uc1" TagName="MenuTracNghiem" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../Styles/myStyle.css" rel="stylesheet" />
    <style type="text/css">
        .table {
            margin: 0 auto;
            width: 100%;
        }

            .table td, .table th {
                border: 1px solid #CCCCCC;
            }

            .table tr:nth-child(1), .table tr:nth-child(1) td {
                background-color: #B7B7B7;
                font-size: 1em;
                font-weight: bold;
                padding: 6px 5px;
                text-align: center;
            }

        .t-center {
            text-align: center;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" runat="server">
    <br />
    <br />
    <br />
    <br />
    <uc1:MenuTracNghiem runat="server" ID="MenuTracNghiem" />
    <h2>Danh Mục Câu Hỏi</h2>


    <div id="contain" style="width: 100%;">
        <table style="margin: 0 auto;">
            <tr>
                <td colspan="3">Danh Mục Câu Hỏi</td>
            </tr>
            <tr>
                <td>Tên Danh  Mục</td>
                <td></td>
                <td>
                    <asp:TextBox ID="txtName" runat="server" Width="400"></asp:TextBox>
                    <div class="msgError">
                        <asp:RequiredFieldValidator ControlToValidate="txtName" ID="RequiredFieldValidator1" runat="server" ErrorMessage="Chưa nhập dữ liệu." Display="Dynamic" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </div>
                </td>
            </tr>
            <tr>
                <td>Mô Tả</td>
                <td></td>
                <td>
                    <asp:TextBox ID="txtDes" runat="server" TextMode="MultiLine" Width="400"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td>
                    <asp:Button CssClass="btn brn-success" ID="btnAdd" runat="server" Text="Thêm" OnClick="btnAdd_Click" />
                    <asp:Button CssClass="btn brn-success" ID="btnUpdate" runat="server" Text="Sửa" OnClick="btnUpdate_Click" />
                </td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td>
                    <div class="msgError">
                        <asp:Literal ID="LiteralError" runat="server"></asp:Literal>
                    </div>
                    <div class="msgSuccess">
                        <asp:Literal ID="LiteralSuccess" runat="server"></asp:Literal>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <asp:GridView ID="GridView1" CssClass="table" runat="server" AllowPaging="True" AutoGenerateColumns="False" EnableModelValidation="True" OnSelectedIndexChanging="GridView1_SelectedIndexChanging" OnRowDeleting="GridView1_RowDeleting" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
                        <Columns>
                            <asp:TemplateField HeaderText="STT.">
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex +1 %>'></asp:Label>
                                    <asp:HiddenField ID="CategoryId" runat="server" Value='<%# Eval("CategoryId") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Name" HeaderText="Tên Danh Mục" />
                            <asp:BoundField HeaderText="Mô Tả" />
                            <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Select" Text="Sửa"></asp:LinkButton>
                                    |
                                    <asp:LinkButton ID="LinkButton2" OnClientClick="return confirm('Các câu hỏi trong chuyên mục này sẽ bị xóa theo.\nBấm Ok để xóa ?')" runat="server" CausesValidation="False" CommandName="Delete" Text="Xóa"></asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle CssClass="t-center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
